<style>
    .layui-iconpicker-body.layui-iconpicker-body-page .hide {
        display: none;
    }
</style>
<link rel="stylesheet" href="__STATIC__/plugs/lay-module/autocomplete/autocomplete.css?v={$version}" media="all">
<script>
    var parameter = '';
</script>
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form">
        <input type="hidden" name="table" value="{$row['table']|default=''}">
        <div class="layui-form-item">
            <label class="layui-form-label">中文字段名称</label>
            <div class="layui-input-block">
                <input type="text" id="name" name="name" class="layui-input" lay-reqtext="请输入字段名" placeholder="请输入字段名" value="">
                <tip>填写模型名。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">字段名[英文]</label>
            <div class="layui-input-block">
                <input type="text" id="field" name="field" class="layui-input" lay-reqtext="请输入字段名" placeholder="请输入字段名" value="">
                <tip>填写字段名。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" id="sort" name="sort" class="layui-input" lay-reqtext="请输入排序" placeholder="请输入排序" value="100">
                <tip>填写排序。</tip>
            </div>
        </div>
        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label required">字段类型</label>
            <div class="layui-input-block">
                <select name="type" class="layui-select" lay-search>
                    {if isset($alldata['field']['type']['option'])}
                    {foreach $alldata['field']['type']['option'] as $key=>$vo}
                    {if $key=='varchar'}
                    <option value="{$key}" selected>{$vo|raw}</option>
                    {else}
                    <option value="{$key}">{$vo|raw}</option>
                    {/if}
                    {/foreach}
                    {/if}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">字段长度</label>
            <div class="layui-input-block">
                <input type="text" id="lang" name="lang" class="layui-input" lay-reqtext="请输入字段长度" placeholder="请输入字段长度" value="255">
                <tip>填写字段长度。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">默认值</label>
            <div class="layui-input-block">
                <input type="text" id="default" name="default" class="layui-input" lay-reqtext="请输入默认值" placeholder="请输入默认值" value="">
                <tip>填写默认值。</tip>
            </div>
        </div>
        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label required">表单类型</label>
            <div class="layui-input-block">
                <select name="formtype" class="layui-select" lay-search>
                    {if isset($alldata['field']['formtype']['option'])}
                    {foreach $alldata['field']['formtype']['option'] as $key=>$vo}
                    <option value="{$key}">{$vo|raw}</option>
                    {/foreach}
                    {/if}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">ajax下拉请求地址</label>
            <div class="layui-input-block">
                <input type="text" id="href" name="href" class="layui-input" lay-reqtext="请输入ajax下拉请求地址" placeholder="请输入ajax下拉请求地址" value="/admin/ajax/ajaxselect">
                <tip>填写ajax下拉请求地址。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选项</label>
            <div class="layui-input-block">
                <textarea type="text" id="option" name="option" class="layui-input" lay-reqtext="请输入选项" placeholder="请输入选项" ></textarea>
                <tip>填写字段单选框，多选框，下拉框的选项。例：0:关闭,1:开启,2:使用</tip>
            </div>
        </div>
        <div class="layui-form-item  layui-row layui-col-xs12">
            <label class="layui-form-label required">链接表</label>
            <div class="layui-input-block">
                <select name="join_table" class="layui-select" lay-search>
                    <option value="">请选择</option>
                    {foreach $getTableList as $key=>$vo}
                    <option value="{$vo.table}">{$vo.name|raw}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">外键[显示的键]</label>
            <div class="layui-input-block">
                <input type="text" id="foreign_key" name="foreign_key" class="layui-input" lay-reqtext="请输入外键" placeholder="请输入外键" value="name">
                <tip>填写外键。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">外联主键[填写的键]</label>
            <div class="layui-input-block">
                <input type="text" id="relationship_primary_key" name="relationship_primary_key" class="layui-input" lay-reqtext="请输入外联主键" placeholder="请输入外联主键" value="id">
                <tip>填写外键。</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea type="text" id="describe" name="describe" class="layui-input" lay-reqtext="请输入描述" placeholder="请输入选项" ></textarea>
                <tip>填写字段单选框，多选框，下拉框的选项。例：0:关闭,1:开启,2:使用</tip>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">到表格</label>
            <div class="layui-input-block">
                <input type="checkbox" name="show" checked lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">编辑</label>
            <div class="layui-input-block">
                <input type="checkbox" name="edit" checked lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">搜索</label>
            <div class="layui-input-block">
                <input type="checkbox" name="search" lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">合计</label>
            <div class="layui-input-block">
                <input type="checkbox" name="total" lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">导出</label>
            <div class="layui-input-block">
                <input type="checkbox" name="export" lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" checked lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">是否主键</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_key" lay-skin="switch" lay-text="开启|禁用">
                <!--<tip>填写排序。</tip>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">宽度</label>
            <div class="layui-input-block">
                <input type="text" id="width" name="width" class="layui-input" lay-reqtext="请输入字段宽度" placeholder="请输入字宽度" value="100">
                <tip>填写模型名。</tip>
            </div>
        </div>

        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>

    </form>
</div>